/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryWxpayResult;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface DeliveryWxpayResultMapper {
    /* @mbggenerated */
    @Delete({
        "delete from delivery_wxpay_result",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /* @mbggenerated */
    @Insert({
        "insert into delivery_wxpay_result (appid, bank_type, ",
        "cash_fee, fee_type, ",
        "is_subscribe, mch_id, ",
        "nonce_str, openid, ",
        "out_trade_no, result_code, ",
        "return_code, sign, ",
        "time_end, total_fee, ",
        "trade_type, transaction_id)",
        "values (#{appid,jdbcType=VARCHAR}, #{bankType,jdbcType=VARCHAR}, ",
        "#{cashFee,jdbcType=VARCHAR}, #{feeType,jdbcType=VARCHAR}, ",
        "#{isSubscribe,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, ",
        "#{nonceStr,jdbcType=VARCHAR}, #{openid,jdbcType=VARCHAR}, ",
        "#{outTradeNo,jdbcType=VARCHAR}, #{resultCode,jdbcType=VARCHAR}, ",
        "#{returnCode,jdbcType=VARCHAR}, #{sign,jdbcType=VARCHAR}, ",
        "#{timeEnd,jdbcType=VARCHAR}, #{totalFee,jdbcType=VARCHAR}, ",
        "#{tradeType,jdbcType=VARCHAR}, #{transactionId,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(DeliveryWxpayResult record);

    /* @mbggenerated */
    @InsertProvider(type=DeliveryWxpayResultSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insertSelective(DeliveryWxpayResult record);

    /* @mbggenerated */
    @Select({
        "select",
        "id, appid, bank_type, cash_fee, fee_type, is_subscribe, mch_id, nonce_str, openid, ",
        "out_trade_no, result_code, return_code, sign, time_end, total_fee, trade_type, ",
        "transaction_id",
        "from delivery_wxpay_result",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="appid", property="appid", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_type", property="bankType", jdbcType=JdbcType.VARCHAR),
        @Result(column="cash_fee", property="cashFee", jdbcType=JdbcType.VARCHAR),
        @Result(column="fee_type", property="feeType", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_subscribe", property="isSubscribe", jdbcType=JdbcType.VARCHAR),
        @Result(column="mch_id", property="mchId", jdbcType=JdbcType.VARCHAR),
        @Result(column="nonce_str", property="nonceStr", jdbcType=JdbcType.VARCHAR),
        @Result(column="openid", property="openid", jdbcType=JdbcType.VARCHAR),
        @Result(column="out_trade_no", property="outTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="result_code", property="resultCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="return_code", property="returnCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="sign", property="sign", jdbcType=JdbcType.VARCHAR),
        @Result(column="time_end", property="timeEnd", jdbcType=JdbcType.VARCHAR),
        @Result(column="total_fee", property="totalFee", jdbcType=JdbcType.VARCHAR),
        @Result(column="trade_type", property="tradeType", jdbcType=JdbcType.VARCHAR),
        @Result(column="transaction_id", property="transactionId", jdbcType=JdbcType.VARCHAR)
    })
    DeliveryWxpayResult selectByPrimaryKey(Integer id);

    /* @mbggenerated */
    @UpdateProvider(type=DeliveryWxpayResultSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(DeliveryWxpayResult record);

    /* @mbggenerated */
    @Update({
        "update delivery_wxpay_result",
        "set appid = #{appid,jdbcType=VARCHAR},",
          "bank_type = #{bankType,jdbcType=VARCHAR},",
          "cash_fee = #{cashFee,jdbcType=VARCHAR},",
          "fee_type = #{feeType,jdbcType=VARCHAR},",
          "is_subscribe = #{isSubscribe,jdbcType=VARCHAR},",
          "mch_id = #{mchId,jdbcType=VARCHAR},",
          "nonce_str = #{nonceStr,jdbcType=VARCHAR},",
          "openid = #{openid,jdbcType=VARCHAR},",
          "out_trade_no = #{outTradeNo,jdbcType=VARCHAR},",
          "result_code = #{resultCode,jdbcType=VARCHAR},",
          "return_code = #{returnCode,jdbcType=VARCHAR},",
          "sign = #{sign,jdbcType=VARCHAR},",
          "time_end = #{timeEnd,jdbcType=VARCHAR},",
          "total_fee = #{totalFee,jdbcType=VARCHAR},",
          "trade_type = #{tradeType,jdbcType=VARCHAR},",
          "transaction_id = #{transactionId,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(DeliveryWxpayResult record);
}